package com.rc.saas.tenant.vo.rc;

import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.rc.saas.tenant.common.utils.StringUtil;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author zhongz
 * @date 20220720
 */
public class ExportRcOperatorAccountRecordVo {
    @ExcelProperty(value = "运营商代码",index = 0)
    private String tenantCode;

    @ExcelProperty(value = "流水类型",index = 1)
    private String recordType;//0充值 1支出

    @ExcelProperty(value = "摘要",index = 2)
    private String explains;

    @ExcelProperty(value = "流水单号",index = 3)
    private String orderNum;

    @ExcelProperty(value = "来源",index = 4)
    private String recordSource;//0平台 1微信 2支付宝

    @ExcelProperty(value = "发生金额",index = 5)
    private BigDecimal amount;

    @ExcelProperty(value = "入账时间",index = 6)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date recordTime;


    @ExcelProperty(value = "收款方名称",index = 7)
    private String entryName;

    @ExcelProperty(value = "收款方类型",index = 8)
    private String entryType;//0平台 1个人用户

    @ExcelProperty(value = "收款方账户余额",index = 9)
    private BigDecimal entryAccount;

    @ExcelProperty(value = "收款方账号",index = 10)
    private String entryAccountNum;

    @ExcelProperty(value = "收款方开户行",index = 11)
    private String entryBank;


    @ExcelProperty(value = "付款方名称",index = 12)
    private String outName;

    @ExcelProperty(value = "付款方类型",index = 13)
    private String outType;//0平台 1个人用户

    @ExcelProperty(value = "付款方账户余额",index = 14)
    private BigDecimal outAccount;

    @ExcelProperty(value = "付款方账号",index = 15)
    private String outAccountNum;

    @ExcelProperty(value = "付款方开户行",index = 16)
    private String outBank;


    @ExcelProperty(value = "状态",index = 17)
    private String status;//0成功 1失败

    @ExcelProperty(value = "备注",index = 18)
    private String remark;

    @ExcelProperty(value = "创建时间",index = 19)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createdTime;


    public String getRecordType() {
        if (StringUtil.isNotBlank(recordType)) {
            if ("0".equals(recordType)) {
                return "充值";
            } else if ("1".equals(recordType)) {
                return "支出";
            }
        }
        return "";
    }

    public String getRecordSource() {
        if (StringUtil.isNotBlank(recordSource)) {
            if ("0".equals(recordSource)) {
                return "平台";
            } else if ("1".equals(recordSource)) {
                return "微信";
            } else if ("2".equals(recordSource)) {
                return "支付宝";
            }
        }
        return "";
    }

    public String getEntryType() {
        if (StringUtil.isNotBlank(entryType)) {
            if ("0".equals(entryType)) {
                return "平台";
            } else if ("1".equals(entryType)) {
                return "个人用户";
            }
        }
        return "";
    }

    public String getOutType() {
        if (StringUtil.isNotBlank(outType)) {
            if ("0".equals(outType)) {
                return "平台";
            } else if ("1".equals(outType)) {
                return "个人用户";
            }
        }
        return "";
    }

    public String getStatus() {
        if (StringUtil.isNotBlank(status)) {
            if ("0".equals(status)) {
                return "成功";
            } else if ("1".equals(status)) {
                return "失败";
            }
        }
        return "";
    }

    public String getTenantCode() {
        return tenantCode;
    }

    public void setTenantCode(String tenantCode) {
        this.tenantCode = tenantCode;
    }

    public void setRecordType(String recordType) {
        this.recordType = recordType;
    }

    public String getExplains() {
        return explains;
    }

    public void setExplains(String explains) {
        this.explains = explains;
    }

    public String getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(String orderNum) {
        this.orderNum = orderNum;
    }

    public void setRecordSource(String recordSource) {
        this.recordSource = recordSource;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public Date getRecordTime() {
        return recordTime;
    }

    public void setRecordTime(Date recordTime) {
        this.recordTime = recordTime;
    }

    public String getEntryName() {
        return entryName;
    }

    public void setEntryName(String entryName) {
        this.entryName = entryName;
    }

    public void setEntryType(String entryType) {
        this.entryType = entryType;
    }

    public BigDecimal getEntryAccount() {
        return entryAccount;
    }

    public void setEntryAccount(BigDecimal entryAccount) {
        this.entryAccount = entryAccount;
    }

    public String getEntryAccountNum() {
        return entryAccountNum;
    }

    public void setEntryAccountNum(String entryAccountNum) {
        this.entryAccountNum = entryAccountNum;
    }

    public String getEntryBank() {
        return entryBank;
    }

    public void setEntryBank(String entryBank) {
        this.entryBank = entryBank;
    }

    public String getOutName() {
        return outName;
    }

    public void setOutName(String outName) {
        this.outName = outName;
    }

    public void setOutType(String outType) {
        this.outType = outType;
    }

    public BigDecimal getOutAccount() {
        return outAccount;
    }

    public void setOutAccount(BigDecimal outAccount) {
        this.outAccount = outAccount;
    }

    public String getOutAccountNum() {
        return outAccountNum;
    }

    public void setOutAccountNum(String outAccountNum) {
        this.outAccountNum = outAccountNum;
    }

    public String getOutBank() {
        return outBank;
    }

    public void setOutBank(String outBank) {
        this.outBank = outBank;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }
}
